square partitioning